<?php

namespace app\model;
use app\util\Tools;
class UserAward extends Base
{
    protected $autoWriteTimestamp = true;
    protected $resultSetType = 'collection';
    protected $updateTime = 'updateTime';
    protected $createTime = 'addTime';


    public function getstatusTextAttr($value, $data) {
        $status = ['1' => '已发状态','2' => '待发状态'];
        return  isset($status[$data['status']])?$status[$data['status']]:'未知';
    }

    public function getmoneyAttr($value) {
        return Tools::bcCalculate($value, 100, '/');
    }

    public function setmoneyAttr($value) {
        return $value * 100;
    }



}
